<?php
	if(!isset($_GET['action']))
	{
		$explodeString = explode(".", $this->buildingText);
	    $story = '';
		foreach( $explodeString as $buildingTextPhrase )
	    {
	        if( $buildingTextPhrase != "" ){
	        $story .= '<p>' . $buildingTextPhrase . '.</p>';
	        }
	    }

		$html = '';
		$html .='<div class="building-choose">';

			$html .= '<span class="building-title"><h1>Welcome to the ' . strtoupper($this->buildingName) . '</h1></span>';
			$html .='<div class="building-story">';
			$html .=$story;
			$html .= '</div>';
	
			$html .='<span class="question-action">What do you want to do ?</span>';
	
			$html .='<div class="building-action">';
			$urlArrayUpgrade = array('controller' =>'buildings', 'action'=>'build');
			$html .='<a href="'.$this->url($urlArrayUpgrade, null, true).'?v='.$this->buildingName.'">Upgrade building</a>';
			$html .= '</div>';
	
			$html .='<div class="building-action">';
			$urlArrayBuy = array('controller' =>'buildings', 'action'=>'units');
			$html .='<a href="'.$this->url($urlArrayBuy, null, true).'?v='.$this->buildingName.'">Unit shop</a>';
			$html .= '</div>';
	
			$urlArrayBack = array('controller' =>'kingdom', 'action'=>'list');
			$html .='<a class="back-action" href="'.$this->url($urlArrayBack, null, true).'">&larr;&nbsp;Back To Kingdom</a>';


		$html .= '</div>';
		echo $html;

	}
?>
